package Com.javaserver.dao;

import Com.javaserver.bean.invite;
import Com.javaserver.utils.DB;

import java.util.List;
import java.util.Map;

public class inviteserver {

    //添加招聘
    public invite addinvite(invite inte){
         int i  = DB.executeUpdate("insert into invite (C_id,C_name,C_age,C_position,C_experience,C_phone,C_home,C_sex,C_birth,C_major,C_education,C_shool,C_time,C_profile)" + " values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",inte.getC_id(), inte.getC_name(),inte.getC_age(),inte.getC_position(),inte.getC_experience(),inte.getC_phone(),inte.getC_home(),inte.getC_sex(),inte.getC_birth(),inte.getC_major(),inte.getC_education(),inte.getC_shool(),inte.getC_time(),inte.getC_profile());
        if (i == -1){
            return null;
        }
        return inte;
    }


    //招聘查询
    public List inlist(Integer page){
        List list=DB.executeQuery("select * from invite limit ?, 10", (page - 1) * 10);
        return  list;
    }

    //详细查询
     public    boolean listX(invite intoken){
       String sql="select * from where C_name=?";
       int i=DB.executeUpdate(sql,intoken.getC_name());
       return  1>0;
     }
     //删除
    public  boolean  delelist(invite invi){
        String sql="delete from invite where C_id=? ";
        int i = DB.executeUpdate(sql,invi.getC_id());
        return 1>0;
    }
}
